package top.kaoshanji.s1ch08a.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 代码清单-s1ch08a-163页a：控制器类定义页面动作
 * @author kaoshanji
 * ^_^
 * create time 2025/4/29 16:58
 */
@Controller
public class MainController {

    @RequestMapping("/home")
    public String home(Model model) {
        model.addAttribute("username", "Katy");
        model.addAttribute("color", "red");
        return "home.html";
    }

}
